package me.youline.dataServer.service;

import me.youline.dataServer.dao.PubMsgStatisticRecorderDAO;
import me.youline.dataServer.entity.PubMsgStatisticRecorder;

import org.perf4j.aop.Profiled;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 公开消息记录业务类
 * @author linhan
 *
 */
@Service
public class PubMsgRecorderService {

	@Autowired
	private PubMsgStatisticRecorderDAO messageRecorderDAO;
	
	/**
	 * 获取公开消息统计记录对象
	 * @param msgId
	 * @param viewUserId
	 * @return
	 */
	@Profiled(tag = "service-获取原创消息统计信息")
	public PubMsgStatisticRecorder getPubMsgStatisticRecorder(Long msgId) {
		PubMsgStatisticRecorder blank = new PubMsgStatisticRecorder();
		blank.setMessageId(msgId);
		blank.setPraiseNum(0);
		PubMsgStatisticRecorder r = messageRecorderDAO.findOne(msgId);
		return r;
	}
	
}
